package com.fish.anne.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name="system_admin_role" )
public class SystemAdminRole extends BaseObject implements Serializable {
    private Long arId;
    private Long adminId;
    private Long roleId;

    
    private String roleName ;
    
    
    @Transient
    public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
    @Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getArId() {
        return this.arId;
    }
    
    public void setArId(Long arId) {
        this.arId = arId;
    }
    
    @Column(name="admin_id", nullable=false)
    public Long getAdminId() {
        return this.adminId;
    }
    
    public void setAdminId(Long adminId) {
        this.adminId = adminId;
    }
    
    @Column(name="role_id", nullable=false)
    public Long getRoleId() {
        return this.roleId;
    }
    
    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SystemAdminRole pojo = (SystemAdminRole) o;

        if (adminId != null ? !adminId.equals(pojo.adminId) : pojo.adminId != null) return false;
        if (roleId != null ? !roleId.equals(pojo.roleId) : pojo.roleId != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (adminId != null ? adminId.hashCode() : 0);
        result = 31 * result + (roleId != null ? roleId.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("arId").append("='").append(getArId()).append("', ");
        sb.append("adminId").append("='").append(getAdminId()).append("', ");
        sb.append("roleId").append("='").append(getRoleId()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
